package factory;

public class Factory {
    public static Product createProduct(String productType) {
        if (productType.equals("A")) {
            return new ProductA();
        } else if (productType.equals("B")) {
            return new ProductB();
        } else {
            throw new IllegalArgumentException("Unknown product type");
        }
    }
}
